home *** CD-ROM | disk | FTP | other *** search
- /*
- * AutoTests.h
- *
- * Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- * Copyright: © 1995 by Visigenic Software, Inc., all rights reserved.
- *
- * 950320 KO I have hacked the ODBC 1.0 header file to work with the
- * QuickTest source from the Windows 2.0 SDK. The intention is to allow
- * the 2.0 QuickTest to work with the 1.0 ODBC Test.
- *
- */
-
- #ifndef __AUTOTESTS
- #define __AUTOTESTS
- #include "SQL.H"
- #include "SQLEXT.H"
-
- #include "macdefs.h"
-
- /*
- * The parameter block passed into DoAutoTest, the auto test shared library's
- * function which performs the test.
- * This is the ODBC Test 1.0 parameter block from the Mac ODBC 1.0 SDK.
- */
-
- typedef struct
- {
- char szSource[20];
- char szValidServer0[20]; /* if this is an empty string then hdbc should be used */
- char szValidServer1[20];
- char szValidLogin0[20];
- char szValidLogin1[20];
- char szValidPassword0[20];
- char szValidPassword1[20];
- char szValidQuery0[200];
- char szParamQuery0[300];
- char szParam0[20];
- long *rglMask;
- GrafPtr pGrafPort; /* this can be used as the GrafPort pointer for DriverConnect*/
- HENV henv; /* these are used when the connection being tested */
- HDBC hdbc; /* is the current connection in ODBC Test */
- int cErrors; /* contains the number of errors encountered during the test run */
- int cStateErrors; /* contains the number of error states encountered during the test run */
- pascal void (*ControlSzWrite)(int, int);
- pascal void (*szWrite)( char*, BOOL);
- } ServerStruct;
-
- /*
- * The function set parent id - this is used to find all of the auto test
- * shared libraries. Auto test shared libraries MUST have this as their
- * function set parent id.
- */
-
- #define kAutoTestParentID "appl:ODBC$AutoTestParentId"
-
-
- /* 950317 KO Added this definition to this header file to support the porting */
- /** of the QuickTest from ODBC 2.0 SDK from Windows. */
- #if ODBCVER >= 0x0200
-
- /* 950317 KO The following defines will need to be checked against Mac */
- /** and Windows. I have just defined them here for expediency. */
-
- #define _MAX_PATH 256
- #define MAX_USER_INFO 256
- #define MAX_KEYWORD_LEN 32
- #define MAXFLUSH 4096
-
- //
- // This structure contains the information found in the .INI file for a
- // data source. The filled out structure is in turn passed to AutoTestFunc
- // to drive the individual tests.
- // This is the ODBC Test 2.0 parameter block used by ODBC Test in the
- // Windows 2.0 SDK.
- //
- typedef struct tagSERVERINFO {
- HWND hwnd; // Output edit window
- char szLogFile[_MAX_PATH]; // Output log file
- HENV henv; // .EXE's henv
- HDBC hdbc; // .EXE's hdbc
- HSTMT hstmt; // .EXE's hstmt
-
- // The following items are gathered from the .INI file and may be defined
- // via the "Manage Test Sources" menu item from ODBC Test
- char szSource[SQL_MAX_DSN_LENGTH+1];
- char szValidServer0[SQL_MAX_DSN_LENGTH+1];
- char szValidLogin0[MAX_USER_INFO+1];
- char szValidPassword0[MAX_USER_INFO+1];
- char szKeywords[MAX_KEYWORD_LEN+1];
-
- // Following are used for run-time
- UINT FAR * rglMask; // Run test mask
- int failed; // Track failures on a test case basis
- int cErrors; // Count of errors
- BOOL fDebug; // TRUE if debugging is to be enabled
- BOOL fScreen; // TRUE if test output goes to screen
- BOOL fLog; // TRUE if test output goes to log
- BOOL fIsolate; // TRUE to isolate output
- UDWORD vCursorLib; // Value for SQL_ODBC_CURSOR on SQLSetConnectOption
- HINSTANCE hLoadedInst; // Instance handle of loaded test
-
- // Following are used for buffering output to edit window
- char szBuff[MAXFLUSH]; // Hold temporary results
- UINT cBuff; // Number of chars in szBuff
- } SERVERINFO;
- typedef SERVERINFO FAR * lpSERVERINFO;
-
- /* 950317 KO I have limited the szLogPrintf routine to just passing 1 string for now */
- /** This is what the QuickTest dll does anyway. Just trying to get someting working. */
-
- BOOL_EXTFUNCDECL_FAR szLogPrintf(lpSERVERINFO lps, BOOL fForce, LPSTR szFmt /*, ...*/);
-
- void_CALLBACK AutoTestFunc(lpSERVERINFO pTestSource);
- BOOL_CALLBACK AutoTestName(LPSTR szName, UINT FAR * cbTestCases);
-
- #endif
-
- #endif